home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 109
/
Vol 109.iso
/
games
/
free_sty.swf
/
scripts
/
DefineSprite_164
/
frame_146
/
DoAction.as
Wrap
Text File
|
2008-11-12
|
873b
|
30 lines
this.fu_mc.onEnterFrame = function()
{
this.vv = 20;
this.mxx = _root.bg_mc.man._x;
this.myy = _root.bg_mc.man._y;
this.bxx = _root.zhu_array[_root.level][this._parent.upn][0];
this.byy = _root.zhu_array[_root.level][this._parent.upn][1];
if(this._parent._currentframe >= 148)
{
this._parent.stop();
}
else
{
this._parent.play();
}
if((this.mxx - this.bxx) * (this.mxx - this.bxx) + (this.myy - this.byy) * (this.myy - this.byy) > this.vv * this.vv)
{
var _loc3_ = Math.atan2(this.byy - this.myy,this.bxx - this.mxx);
this._parent._x += this.vv * Math.cos(_loc3_);
this._parent._y += this.vv * Math.sin(_loc3_);
}
else
{
this._parent._x = this.bxx;
this._parent._y = this.byy;
this._parent.gotoAndPlay(148);
delete this.onEnterFrame;
}
};